export interface Position {
    x: number;
    y: number;
}

export interface Endpoint {
    id: string;
    type: 'input' | 'output';
    name: string;
}

export interface Param {
    name: string;
    type: string;
    required?: boolean;
}

export interface Node {
    id: string;
    type: string;
    position: {
        x: number;
        y: number;
    };
    name: string;
    title: string;
    icon: string;
    color: string;
    endpoints: {
        input: Endpoint[];
        output: Endpoint[];
    };
    params: {
        input: any[];
        output: any[];
    };
    draggable?: boolean;
    modelType?: string;
    temperature?: number;
    prompt?: string;
    condition?: string;
    iterationKey?: string;
    maxIterations?: number;
    code?: string;
    language?: string;
    template?: string;
    url?: string;
    method?: string;
    headers?: Record<string, string>;
    requestBody?: Record<string, any>;
    connectionString?: string;
    query?: string;
    agentPrompt?: string;
    tools?: Array<{ name: string; description: string }>;
    emailConfig?: {
        subject?: string;
        recipients?: string[];
        body?: string;
        attachments?: string[];
    };
}

export interface Connection {
    id: string;
    source: string;
    target: string;
}

export interface FlowData {
    nodes: Node[];
    connections: Connection[];
}

export type NodeType =
    'start' | 'end' | 'model' | 'agent' | 'ifelse' |
    'iterator' | 'code' | 'template' | 'http' | 'database' | 'email'; 